<?php
include "header.php";
echo "<table class='table table-striped table-bordered bootstrap-datatable datatable' >";
echo "<tr>";
echo "<td><b>Id</b></td>";
echo "<td><b>Geofence Id</b></td>";
echo "<td><b>Title</b></td>";
echo "<td><b>Message</b></td>";
echo "<td><b>Url</b></td>";
echo "<td><b>Image Url</b></td>";
echo "</tr>";

$db = new DB_Functions();
$query = $db->getAllIklan();
if ($query != false) {
    $num_row = mysql_num_rows($query);
} else {
    $num_row = 0;
}
if ($num_row > 0) {
    while ($row = mysql_fetch_array($query)) {

        echo "<tr>";
        echo "<td valign='top'>" . nl2br($row['id']) . "</td>";
        echo "<td valign='top'>" . nl2br($row['geofence_id']) . "</td>";
        echo "<td valign='top'>" . nl2br($row['title']) . "</td>";
        echo "<td valign='top'>" . nl2br($row['message']) . "</td>";
        echo "<td valign='top'>" . nl2br($row['url']) . "</td>";
        echo "<td valign='top'>" . nl2br($row['image_url']) . "</td>";
        echo "<td valign='top'><a href=edit_iklan.php?id={$row['id']}>Edit</a></td><td><a href=delete_iklan.php?id={$row['id']}>Delete</a></td> ";
        echo "</tr>";
    }
}
echo "</table>";
echo "<a href=insert_iklan.php>New Row</a>";
include "footer.php";
?>